﻿/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn， 注意去除风格后缀和大小写，如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward，如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  {
    path: '/home',
    icon: 'home',
    // hideInMenu: true,
    layout: false,
    name: 'home',
    component: './home/index',
  },
  // {
  //   path: '/dashboard',
  //   name: 'dashboard',
  //   icon: 'dashboard',
  //   routes: [
  //     {
  //       path: '/dashboard',
  //       redirect: '/dashboard/workplace',
  //     },
  //     // {
  //     //   name: 'analysis',
  //     //   icon: 'smile',
  //     //   path: '/dashboard/analysis',
  //     //   component: './dashboard/analysis',
  //     // },
  //     // {
  //     //   name: 'monitor',
  //     //   icon: 'smile',
  //     //   path: '/dashboard/monitor',
  //     //   component: './dashboard/monitor',
  //     // },
  //     {
  //       name: 'workplace',
  //       icon: 'smile',
  //       path: '/dashboard/workplace',
  //       component: './dashboard/workplace',
  //     },
  //   ],
  // },

  {
    path: '/common-menu',
    icon: 'icon-gonggong-caidan',
    name: 'common-menu',
    routes: [
      {
        path: '/common-menu',
        redirect: '/common-menu/user',
      },
      {
        name: 'project',
        icon: 'project',
        path: '/common-menu/project',
        component: './common-menu/project',
      },

      {
        name: 'environment',
        icon: 'icon-huanjingguanli',
        path: '/common-menu/environment',
        component: './common-menu/environment',
      },

      {
        name: 'user',
        icon: 'user',
        path: '/common-menu/user',
        component: './common-menu/user',
      },

      {
        name: 'role',
        icon: 'SafetyCertificate',
        path: '/common-menu/role',
        component: './common-menu/role',
      },

    ],
  },

  {
    path: '/api-auto',
    icon: 'api',
    name: 'api-auto',
    routes: [
      {
        path: '/api-auto',
        redirect: '/api-auto/case',
      },
      {
        name: 'api',
        icon: 'icon-APIguanli',
        path: '/api-auto/api',
        component: './api-auto/api',
      },
      {
        name: 'api-form',
        path: '/api-auto/api-form',
        hideInMenu: true,
        component: './api-auto/api/form',
      },

      {
        name: 'case',
        icon: 'icon-jiekouyongli',
        path: '/api-auto/case',
        component: './api-auto/case',
      },

      {
        name: 'case-form',
        path: '/api-auto/case-form',
        hideInMenu: true,
        component: './api-auto/case/form',
      },


      {
        name: 'api-module',
        icon: 'icon-mokuai',
        path: '/api-auto/api-module',
        component: './api-auto/api-module',
      },

      {
        name: 'api-case-module',
        icon: 'icon-mokuai',
        path: '/api-auto/api-case-module',
        component: './api-auto/api-case-module',
      },
    ],
  },


  {
    path: '/ui-auto',
    icon: 'build',
    name: 'ui-auto',
    routes: [
      {
        path: '/ui-auto',
        redirect: '/ui-auto/case',
      },
      {
        name: 'module',
        icon: 'icon-mokuai',
        path: '/ui-auto/module',
        component: './ui-auto/module',
      },
      {
        name: 'case',
        icon: 'icon-test-case-group2',
        path: '/ui-auto/case',
        component: './ui-auto/case',
      },
      {
        name: 'case-form',
        path: '/ui-auto/case-form',
        hideInMenu: true,
        component: './ui-auto/case/form',
      },
    ],
  },

  {
    path: '/stress-test',
    icon: 'icon-kaiqiyace',
    name: 'stress-test',
    routes: [
      {
        path: '/stress-test',
        redirect: '/stress-test/case',
      },
      {
        name: 'module',
        icon: 'icon-mokuai',
        path: '/stress-test/module',
        component: './stress-test/module',
      },
      {
        name: 'case',
        icon: 'icon-xinicon_huabanfuben',
        path: '/stress-test/case',
        component: './stress-test/case',
      },
      {
        name: 'case-form',
        path: '/stress-test/case-form',
        hideInMenu: true,
        component: './stress-test/case/form',
      },

    ],
  },

  {
    path: '/report',
    icon: 'Fund',
    name: 'report',
    routes: [
      {
        path: '/report',
        redirect: '/report/ui-test',
      },
      {
        name: 'api-test',
        icon: 'icon-jiekouceshi',
        path: '/report/api-test',
        component: './report/api-test',
      },
      {
        name: 'api-test-detail',
        path: '/report/api-test-detail',
        hideInMenu: true,
        component: './report/api-test/detail',
      },

      {
        name: 'stress-test',
        icon: 'icon-yaliceshi',
        path: '/report/stress-test',
        component: './report/stress-test',
      },
      {
        name: 'stress-test-detail',
        path: '/report/stress-test-detail',
        hideInMenu: true,
        component: './report/stress-test/detail',
      },

      {
        name: 'ui-test',
        icon: 'icon-UIceshi',
        path: '/report/ui-test',
        component: './report/ui-test',
      },
      {
        name: 'ui-test-detail',
        hideInMenu: true,
        path: '/report/ui-test-detail',
        component: './report/ui-test/detail',
      },
    ],
  },

  {
    path: '/test-plan',
    icon: 'Profile',
    name: 'test-plan',
    routes: [
      {
        path: '/test-plan',
        redirect: '/test-plan/timed-schedule',
      },
      {
        name: 'timed-schedule',
        icon: 'icon-dingshijihua',
        path: '/test-plan/timed-schedule',
        component: './test-plan/timed-schedule',
      },
    ],
  },

  // {
  //   path: '/file-management',
  //   icon: 'File',
  //   name: 'file-management',
  //   routes: [
  //     {
  //       path: '/file-management',
  //       redirect: '/file-management/video',
  //     },
  //     {
  //       name: 'video',
  //       icon: 'VideoCamera',
  //       path: '/file-management/video',
  //       component: './file-management/video',
  //     },
  //   ],
  // },

  {
    path: '/user',
    layout: false,
    routes: [
      {
        path: '/user/login',
        layout: false,
        name: 'login',
        component: './user/login',
      },
      {
        path: '/user',
        redirect: '/user/login',
      },
      {
        name: 'register-result',
        icon: 'smile',
        path: '/user/register-result',
        component: './user/register-result',
      },
      {
        name: 'register',
        icon: 'smile',
        path: '/user/register',
        component: './user/register',
      },
      {
        component: '404',
        path: '/user/*',
      },
    ],
  },


  {
    name: 'account',
    icon: 'user',
    path: '/account',
    hideInMenu: true,
    routes: [
      {
        path: '/account',
        redirect: '/account/center',
      },
      {
        name: 'center',
        icon: 'smile',
        path: '/account/center',
        component: './account/center',
      },
      {
        name: 'settings',
        icon: 'smile',
        path: '/account/settings',
        component: './account/settings',
      },
    ],
  },
  {
    path: '/',
    redirect: '/home',
  },
  {
    component: '404',
    path: '/*',
  },
];
